# for i in range(101):
#     if i%2 !=0:
#         print(i,end=',')
# 爱因斯坦曾出过这样一道有趣的数学题：有一个长阶梯，若每步上2阶，最后剩1阶；若每步上3阶，最后剩2阶；若每步上5阶，最后剩4阶；若每步上6阶，最后剩5阶；只有每步上7阶，最后刚好一阶也不剩。
# for x in range(1,100):
#     for y in range(1,100):
#         for z in range(1,100):
#             for a in range(1,100):
#                 for b in range(1,100):
#                     if (2*x+1)==(3*y+2)==(5*z+4)==(6*a+5)==(7*b):
#                         print('共有台阶%s阶！'%b)

#
# for x in range(1,200):
#     if (x%2==1) and (x%3==2) and (x%5==4) and (x%6==5) and (x%7==0):
#         print(x)
x=7
i=1
flag=0
while i<=100:
    if (x%2==1) and (x%3==2) and (x%5==4) and (x%6==5) and (x%7==0):
        flag=1
    else:
        x=7*(i+1)
    i=i+1
if flag ==1:
    print('阶梯数是',x)
else:
    print('在范围内找不到答案！')

# 2x+1=n
# 3y+2=n
# 5z+4=n
# 6a+5=n
# 7b=n
